<#include "../common/layout.ftl"/>
<@layout>
<div width="100%" style="height: 900px;">
	<div class="dxfsqd_title">同城配送订单</div>
	<div class="dxfsqd_shearch">
		<form method="post" action="/categoryorder/deliveryList" class="form-inline">
			<label><span>订单号：</span><input type="text" class="input-medium" style="height: 30px" name="id"/></label> 
			<button type="submit" class="btn "><i></i>查询</button>
			<button type="button" class="btn btn-info" onclick="javascript:history.back();">返回</button>
			<label><span>导出</span><a class="dc_exc"  href="/order/cancelList">订单总数(${totalNum})</a></label>
		</form>
</div>
<div class="dxfsqd_table">

	<table class="table table-bordered table-striped">
		<thead>
		  <tr>
			<th scope="col">单号</th>
			<th scope="col">订单所属城市</th>
			<th scope="col">订单种类</th>
			<th scope="col">订单状态</th>
			<th scope="col">联系人</th>
			<th scope="col">联系电话</th>
			<th scope="col">公斤数</th>
			<th scope="col">性别</th>
			<th scope="col">取件地</th>
			<th scope="col">目的地</th>
			<th scope="col">预约时间</th>
			<th scope="col">到达联系人</th>
			<th scope="col">到达联系电话</th>
			<th scope="col">下单时间</th>
			<th scope="col">发布时间</th>
			<th scope="col">备注</th>
			<th scope="col">操作</th>
		  </tr>
		</thead>
		<tbody>
		<#list page.list as order>
		  <tr>
		    <td>${order.id}</td>
		    <td>
			  ${order.city!""}
		    </td>
			<td>
			   <#if order.order_category_type ??>
					<#list session.orderTypeMapList as orderType>
		    			<#if orderType.value == order.order_category_type>
		    			  ${orderType.name}
		    			</#if>
		    		</#list>
	    	    </#if>
			</td>
			<td>
			 <#list session.orderStatusTypeArray as orderStatusType>
			 	<#if orderStatusType.orderStatus == order.order_state>
			 		${orderStatusType.orderName}
			 	</#if>
			 </#list>
			</td>
			<#if order.member_id == 0>
				<td>
				  ${order.real_name!""}
				</td>
				<td>
				  ${order.cell_phone!""}
				</td>
				<td>
				  ${order.weight!""}
				</td>
				<td>
				  <#if order.sex??>
					  <#if order.sex == 0>
					  	<span class="label label-info">男</span>
					  <#elseif order.sex == 1>
					  	<span class="label label-warning">女</span>
					  <#else>
					  	<span class="label label-inverse">未知</span>
					  </#if>
				  </#if>
				</td>
		  	<#else>
				<td>
				  ${order.real_name2!""}
				</td>
				<td>
				  ${order.cell_phone2!""}
				</td>
				<td>
				  ${order.weight!""}
				</td>
				<td>
				  <#if order.sex2??>
					  <#if order.sex2 == 0>
					  	<span class="label label-info">男</span>
					  <#elseif order.sex2 == 1>
					  	<span class="label label-warning">女</span>
					  <#else>
					  	<span class="label label-inverse">未知</span>
					  </#if>
				  </#if>
				</td>
		  	</#if>
			<td>
			 ${order.startpoint!" "}
			</td>
			<td>
			 ${order.endpoint!" "}
			</td>
			<td>
			 ${order.point_time!" "}
			</td>
			<td>
			 ${order.receive_name!" "}
			</td>
			<td>
			 ${order.receive_phone!" "}
			</td>
			<td>
			<#if order.create_time??> 
			 ${order.create_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			</#if>
			</td>
			<td>
			 <#if order.publish_time??> 
			 ${order.publish_time?string("yyyy年MM月dd日HH时mm分ss秒") }  
			</#if>
			</td>
			</td>
			<td>
			 ${order.remark!" "}
			</td>
			<td nowrap>
			     <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="cf" href="/order/assignmentDriver/${order.id}" target="_blank" >派单</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="cf" href="/order/addressupdate/${order.id}"><i class="icon-leaf icon-white"></i> 修改出发地目的地</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="cf" href="/order/cancelNotAccept/${order.id}"  >取消</a>
				 </#if>
				 <#if session.userRole == 'admin' || session.userRole == 'brandManager' || session.userRole == 'middleManager' || session.userRole == 'customerCenter'>
				 	<a class="cf" href="/order/assignment/${order.id}" >重发</a>
				 </#if>
				  <#if (order.timeDiffe?exists)>
				  <#if (order.timeDiffe>=3)>
			      <embed id = "soundControl1"  src="/sound.mp3"  mastersound hidden = "true"  loop ="false"  autostart = "true"></embed>
			      </#if>
			      </#if>
			</td>
			
			
		  </tr>
		</#list>
		</tbody>
	</table>
	<#include "../common/paginate.ftl" />
	<@paginate currentPage=page.pageNumber totalPage=page.totalPage actionUrl="/categoryorder/deliveryList/" />
</div>
</div>

</@layout>